<!--
 * @Author: your name
 * @Date: 2021-12-31 16:00:40
 * @LastEditTime: 2022-01-09 11:09:35
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue\vue-douban-pc\src\views\Information.vue
-->
<template>
    <div class="info-box">
        <div class="bg"></div>
        <InformationSidebar v-if="hasAdmin"></InformationSidebar>
        <UserSidebar v-else></UserSidebar>
        <router-view />
    </div>
</template>

<script>
import InformationSidebar from "@/components/InformationSidebar.vue";
import UserSidebar from "../components/UserSidebar.vue";
import { getUserInfo } from "../utils/auth";
export default {
    name: 'VueInformation',

    data() {
        return {
            admin: null
        };
    },

    mounted() {

    },
    computed: {
        hasAdmin() {
            return !!this.admin
        }
    },
    created() {
        this.admin = getUserInfo().users.admin;
    },
    components: {
        InformationSidebar,
        UserSidebar
    },
    methods: {

    },
};
</script>

<style lang="scss" scoped>
.info-box {
    .bg {
        position: fixed;
        width: 100%;
        height: 100%;
        background: url(../assets/images/bg_2.jpg) no-repeat;
        background-size: cover;
        background-position: center;
        z-index: -5;
        opacity: 0.8;
    }
}
</style>